package com.hmy.infrastructure;

import com.hmy.common.platform.CcpInitService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;

@EnableFeignClients(basePackages = {"com.hmy"})
@EnableDiscoveryClient
@SpringBootApplication
@ComponentScan(basePackages = {"com.hmy"})
public class Application {

    public static void main(String[] args) throws Exception {

        if (args.length != 3)
        {
            throw new Exception("Start server is error");
        }

        //设置系统环境参数
        CcpInitService.getInstance().setSystemProperty(args);

        SpringApplication springApplication = new SpringApplication(Application.class);
        springApplication.run(args);

    }
}
